/*
 * @Author: huyuhang
 * @Data:
 * @LastEditors: huyuhang
 * @LastEditTime: 2024-03-22 17:21:37
 * @Description: 写点儿注释
 */
import request from '@/config/axios'

export interface TaskVO {
  id: string
  name: string
  progress: number
  failReason: string
  scanMethod: number
  execMethod: number
  detectionCycle: string
  detectionCycleNum: number
  execTime: Date
  collectFileUrl: string
  createTime: Date
  type: number
  status: number
  scanTemplateId: string
  collectTargetType: string
  targetIps: string
  excludeIps: string
  department: string
}

// 统计数据
export const getStatistics = async (data) => {
  return await request.post({ url: '/amp/asset-task/statistics', data })
}

// 查询列表
export const getTaskList = async (data) => {
  return await request.postOriginal({ url: '/amp/asset-task/page', data })
}

export const deleteData = async (data) => {
  return await request.postOriginal({ url: '/amp/asset-task/delete', data })
}

export const taskType = async () => {
  return await request.get({ url: '/api/toolkit/v1/bus/option/detection/type' })
}

export const operation = async (params) => {
  return await request.get({ url: '/amp/asset-task/operation', params })
}

export const modifyApiType = async (data) => {
  return await request.post({ url: '/api/toolkit/v1/asset/task/modify/api/type', data })
}

// 检测任务列表查询
export const list = async (data) => {
  return await request.post({ url: '/api/toolkit/v1/detection/task/list', data })
}

export const modifyAssetType = async (data) => {
  return await request.post({ url: '/api/toolkit/v1/asset/task/modify/asset/type', data })
}

export const importSystemResult = async (data) => {
  return await request.post({ url: '/api/toolkit/v1/asset/task/system/import/result', data })
}

export const importApiResult = async (data) => {
  return await request.post({ url: '/api/toolkit/v1/asset/task/api/import/result', data })
}

// 归属系统
export const getSimpleSystemList = async (params) => {
  return await request.get({ url: '/amp/info-system/option', params })
}

//下载EXCEL模板
export const downLoadExcel = (params) => {
  return request.download({
    url: '/amp/asset-task/offline-download',
    params
  })
}
